package com.baosight.sczx.zm.cm.service;

import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.ep.ServiceEPBase;
import com.baosight.sczx.common.zm.cInterface.Department;
import com.baosight.sczx.common.zm.cInterface.cs.InitialData;
import com.baosight.sczx.zm.cm.domain.ZMCMImportmaterialDetail;

public class ServiceZMCMJ4 extends ServiceEPBase 
{
	/**
	 * 
	 * <p>Function: initLoad</p>
	 * <p>Description: 初始化</p>
	 * <p>return value: ServiceZMCMJ4</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-12-12下午04:23:47 bobswang
	 * </p>
	 *
	 */
	public EiInfo initLoad(EiInfo inInfo) {
		inInfo.addBlock(EiConstant.resultBlock).set("showCount", "true");//如果不加这个，翻页的统计和显示是错误的
		EiInfo outInfo = this.query(inInfo);
		
		outInfo.addBlock(InitialData.getInstance().getEiBlockByNo("cmes.cs.units"));//构造计量单位下拉框
		outInfo.addBlock(Department.getInstance().getConstructionUnit("cmes.cm.org", "orgCode", "orgName", false));
		
		return outInfo;
	}
	/**
	 * 
	 * <p>Function: query</p>
	 * <p>Description: 查询</p>
	 * <p>return value: ServiceZMCMJ4</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-12-12下午04:24:01 bobswang
	 * </p>
	 *
	 */
	@Override
	public EiInfo query(EiInfo inInfo) 
	{
		EiInfo outInfo = super.query(inInfo, "ZMCMWholeQuery.queryImportMaterial",new ZMCMImportmaterialDetail());
		
		return outInfo;
	}
}
